Conventionally, when managing storage devices, for example, HDDs (Hard Disk Drives), in a storage apparatus, data is stored in logical blocks in the HDDs by recognizing a 512-B (bytes) block size as a logical block (logical block composed of 512-B long data). Under this circumstance, an 8-B guarantee code is sometimes added to data in order to deal with the occurrence of failures in the HDDs.
An LRC (Longitudinal Redundancy Check) obtained by a host computer performing an exclusive OR operation on a logical address of a logical block designated as an access destination and data of the logical block is used as the above-mentioned guarantee code.
The logical address is used to detect an error of the address of a storage area to which logical block data is written. The LRC is used as an error detection code to detect an error of the logical block data.
If the guarantee code is added to the logical block, a data management unit handled in the storage apparatus may be sometimes different from a data management unit in the HDD. For example, the HDD where the block length (sector length) is fixed to the logical block size stores data in logical blocks. Accordingly, if the block size is increased by adding the guarantee code to the logical block, the logical block data with the guarantee code may not be stored, without any change, according to the HDD format.
So, block size conversion processing executed in the storage apparatus is suggested in order to solve the above-described problem.
For example, when 520-B data which is obtained by adding the 8-B guarantee code to the 512-B data is written to a storage device in which sectors are managed every 512 B, a suggested method is to read data to be stored in a plurality of sectors to a cache memory, write the 520-B data to the relevant part, thereby update part of the data, and then write the updated data to the sectors (see Patent Literature 1).
Another suggested method is to: form data so that the guarantee code is included as part of 512-B data; and rewrite the guarantee code and add the guarantee code to the 512-B data when writing data; and read the guarantee code and check correctness of the data when reading the data (see Patent Literature 2).
Another suggested method, when writing 520-B data, which is obtained by adding an 8-B guarantee code to 512-B data, to HDDs in which sectors are managed using the 512 B sector size, is to write 64 pieces of 520-B data to 65 sectors and the guarantee codes are collected and written to the 65th sector (see Patent Literature 3).